<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>ArithmeticError</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="class.argumentcounterror.html">« ArgumentCountError</a></li>
      <li style="float: right;"><a href="class.assertionerror.html">AssertionError »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="reserved.exceptions.html">预定义异常</a></li>
    <li>ArithmeticError</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.arithmeticerror" class="reference">
 <h1 class="title">ArithmeticError</h1>
 
 
 <div class="partintro"><p class="verinfo">(PHP 7, PHP 8)</p>
 

  <div class="section" id="arithmeticerror.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    当执行数学运算发生错误时抛出 
    <span class="ooclass"><strong class="classname">ArithmeticError</strong></span> 。
    这些错误包括尝试执行负数的位移，以及对任何可能会导致值超出 <span class="type">int</span> 
    的范围 <span class="function"><a href="function.intdiv.html" class="function">intdiv()</a></span> 调用。
   </p>
  </div>

 
  <div class="section" id="arithmeticerror.synopsis">
   <h2 class="title">类摘要</h2>
 

   <div class="classsynopsis">
    <div class="ooclass">
     
    </div>

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">ArithmeticError</strong>
     </span>

     <span class="ooclass">
      <span class="modifier">extends</span>
       <a href="class.error.html" class="classname">Error</a>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 继承的属性 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">protected</span>
     <span class="type">string</span>
      <var class="varname"><a href="class.error.html#error.props.message">$<var class="varname">message</var></a></var><span class="initializer"> = &quot;&quot;</span>;</div>
<div class="fieldsynopsis"><span class="modifier">private</span>
     <span class="type">string</span>
      <var class="varname"><a href="class.error.html#error.props.string">$<var class="varname">string</var></a></var><span class="initializer"> = &quot;&quot;</span>;</div>
<div class="fieldsynopsis"><span class="modifier">protected</span>
     <span class="type">int</span>
      <var class="varname"><a href="class.error.html#error.props.code">$<var class="varname">code</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">protected</span>
     <span class="type">string</span>
      <var class="varname"><a href="class.error.html#error.props.file">$<var class="varname">file</var></a></var><span class="initializer"> = &quot;&quot;</span>;</div>
<div class="fieldsynopsis"><span class="modifier">protected</span>
     <span class="type">int</span>
      <var class="varname"><a href="class.error.html#error.props.line">$<var class="varname">line</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">private</span>
     <span class="type">array</span>
      <var class="varname"><a href="class.error.html#error.props.trace">$<var class="varname">trace</var></a></var><span class="initializer"> = []</span>;</div>
<div class="fieldsynopsis"><span class="modifier">private</span>
     <span class="type">?</span><span class="type"><span class="type"><a href="class.throwable.html" class="type Throwable">Throwable</a></span><span class="type"></span></span>
      <var class="varname"><a href="class.error.html#error.props.previous">$<var class="varname">previous</var></a></var><span class="initializer"> = null</span>;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 继承的方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><a href="error.getmessage.html" class="methodname">Error::getMessage</a></span>(): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><a href="error.getprevious.html" class="methodname">Error::getPrevious</a></span>(): <span class="type"><span class="type">?</span><span class="type"><a href="class.throwable.html" class="type Throwable">Throwable</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><a href="error.getcode.html" class="methodname">Error::getCode</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><a href="error.getfile.html" class="methodname">Error::getFile</a></span>(): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><a href="error.getline.html" class="methodname">Error::getLine</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><a href="error.gettrace.html" class="methodname">Error::getTrace</a></span>(): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><a href="error.gettraceasstring.html" class="methodname">Error::getTraceAsString</a></span>(): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="error.tostring.html" class="methodname">Error::__toString</a></span>(): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">private</span> <span class="methodname"><a href="error.clone.html" class="methodname">Error::__clone</a></span>(): <span class="type"><span class="type void">void</span></span></div>

   }</div>
 

 
  </div>
 </div>
</div>
</div></div></body></html>